<?php
$fp = fopen('afb.txt','r');
$Map = array();
if($fp){
	$i = 1;
	$level = 101;
	while(!feof($fp)){
		$str = trim(fgets($fp));
		$arr = explode('：',$str);
		if(preg_match('/地图名称/',$str)){
			$Map['L_SingleCross_'.$level.'_MapName0'] = $arr[1];
		}elseif(preg_match('/地图等级/',$str)){
			//$Map[$level]['Level'] = str_replace('级','',$arr[1]);
		}elseif(preg_match('/开启条件/',$str)){
			//$Map[$level]['Condtion'] = str_replace('级','',$arr[1]);
		}elseif(preg_match('/挑战奖励/',$str)){
			$Map['L_SingleCross_'.$level.'_MapDesc0'] = $arr[1];
		}else{
			$level++;
		}
	}
}
fclose($fp);

$content = var_export($Map, TRUE);
$varname = 'demo';
$content="<?php\r\n\${$varname}=$content;\n?>";
$file = '../tmp/cache.php';
file_put_contents($file,$content);

echo 'over';




?>